/*
 * 版权所有(c)  1952110078@qq.com  2022 - 2022
 */

package com.ldc.module_main.adaapter;

import android.widget.ImageView;

import com.ldc.commonlibs.common.RecyclerAdapterBase;
import com.ldc.commonlibs.common.RecyclerViewHolder;
import com.ldc.commonlibs.utils.GlideUtil;
import com.ldc.commonlibs.utils.NumberUtil;
import com.ldc.module_main.R;
import com.ldc.module_main.model.PersonalizedModel;
import com.ldc.module_main.model.UserPlayListModel;

/**
 * @author liudc
 * @since 2022/7/21 23:29
 */
public class UserPlayAdapter extends RecyclerAdapterBase<UserPlayListModel.PlaylistBean> {

    public UserPlayAdapter() {
        super(R.layout.main_layout_view_item_personalized);
    }

    @Override
    protected void convertData(RecyclerViewHolder holder, UserPlayListModel.PlaylistBean data, int position) {
        ImageView imageView = (ImageView) holder.getView(R.id.iv_logo);
        GlideUtil.setImageViewRadius(imageView, data.getCoverImgUrl(), 10);
        holder.setText(R.id.tv_name, data.getName());
        holder.setText(R.id.tv_play, NumberUtil.int2String(Integer.parseInt(data.getPlayCount())));
    }
}
